home *** CD-ROM | disk | FTP | other *** search
/ SGI MineSet 2.5 / SGI MineSet 2.5.iso / movies / playmovies < prev    next >
Text File  |  1998-05-12  |  2KB  |  77 lines

  1. #!/bin/ksh
  2. ##################################################################################
  3. # ** Copyright 1991-1998, Silicon Graphics, Inc.                                 #
  4. # ** All Rights Reserved.                                                        #
  5. # **                                                                             #
  6. # ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;      #
  7. # ** the contents of this file may not be disclosed to third parties, copied or  #
  8. # ** duplicated in any form, in whole or in part, without the prior written      #
  9. # ** permission of Silicon Graphics, Inc.                                        #
  10. ##################################################################################
  11.  
  12. MOVIEPLAYER="movieplayer"
  13. STOREDIR="/usr/lib/MineSet/demos/movies"
  14. USAGE="$0 [-l(oop) | <file>.mov | -help ] (# of times)"
  15.  
  16. if [[ ! -f ./movieplayer ]]
  17. then
  18.   print "\n\007$MOVIEPLAYER not found. Please run the following command"
  19.   print "cp $STOREDIR/movieplayer .\n"
  20.   exit 3
  21. fi
  22.  
  23. if (($# == 0 || $# > 3))
  24. then
  25.   print $USAGE
  26.   exit 3
  27. fi
  28.  
  29. exec 2>/dev/null
  30.  
  31. case $1 in
  32.  
  33. -h*) print "$0 \n"
  34.        print "        -help : print this message"
  35.        print "           -l : play the movies continiously"
  36.        print "   <file>.mov : play the specified movie\n\n"
  37.        print "   you can give the script a number value as the second argument"
  38.        print "   where the # tells the script to loop that # number of times\n"
  39.        print "   For example: \n\t\t $0 -c 3 \n\n   will play all the movies 3 times in a row \n"
  40.        exit 3;;
  41.  
  42. -l*) if  [[ $2 = "" ]]
  43.     then 
  44.       for movie in `ls -1 *mov`
  45.       do 
  46.        $MOVIEPLAYER -nofork -l 1 $movie
  47.       done
  48.     else
  49.      num=0
  50.      while (($num < $2))
  51.      do
  52.       ((num = num + 1))
  53.       for movie in `ls -1 *mov`
  54.       do 
  55.         $MOVIEPLAYER -nofork -l 1 $movie
  56.       done   
  57.     done
  58.     fi;;
  59.  
  60. *mov) if  [[ $2 = "" ]]
  61.       then 
  62.         $MOVIEPLAYER -nofork -l 1 $1 
  63.       else
  64.         $MOVIEPLAYER -nofork -l $2 $1
  65.       fi;;
  66.  
  67. *)   print $USAGE
  68.      exit 3;;
  69. esac
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.